import request from '@/utils/request'
export const getFileList = params => {
  return request.get('/admin/file', { params })
}
export const uploadFile = (file, type, callback) => {
  const formData = new FormData()
  formData.append('file', file)
  formData.append('type', type)
  return request.post('/admin/file/upload', formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    onUploadProgress: callback
  })
}
export const deleteFile = id => {
  return request.delete(`/admin/file/${id}`)
}
export const updateFile = data => {
  return request.put(`/admin/file`, data)
}
